package com.eqdd.yiqidian.ui.gongneng.renshi.meeting

import android.content.Intent
import android.view.View
import com.eqdd.yiqidian.base.Config
import com.eqdd.yiqidian.bean.EnterBean
import com.eqdd.yiqidian.box.ItemDecoration.DividerLineItemDecoration
import com.eqdd.yiqidian.ui.base.BaseEnterActivity
import com.eqdd.yiqidian.utils.ToastUtil
import kotlinx.android.synthetic.main.activity_enter.*

/**
 * 会议管理
 * Created by jhj on 18-5-28.
 */

class MeetingManagerActivity : BaseEnterActivity() {

    override fun itemClick(p: Int) {
        val clazz = enterBeans[p].clazz
        val intent = enterBeans[p].intent
        if (intent != null) {
            startActivity(intent)
        } else if (clazz != null) {
            startActivity(clazz)
        } else {
            ToastUtil.showShort("该模块暂未开发")
        }
    }

    override fun initEnterData() {
        val intent = Intent(this, MeetingNoticeListActivity::class.java)
        intent.putExtra(Config.TYPE, 0)
        initTopTitleBar(View.VISIBLE, "会议管理")
        enterBeans.add(EnterBean("会议类型").setClazz(MeetingTypeListActivity::class.java))
        enterBeans.add(EnterBean("会议通知").setIntent(intent))
        enterBeans.add(EnterBean("会议签到").setClazz(MeetingSignInActivity::class.java))
        recycler_view.addItemDecoration(DividerLineItemDecoration(this))
    }

}
